package Z10InteerBian.Sockednlink.LinkTestNumber;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author 李某
 * * @date 2021/10/21
 * *物有本末，事有终始。知其先后者，则近道矣！
 * *荷花开满池塘的前一天还是半塘荷花半塘云。
 */
public class Server {
    public static void main(String[] args) {
        try {
            ServerSocket ss = new ServerSocket(8888);

            System.out.println("监听端口号：8888");
            Socket s = ss.accept();

            InputStream is = s.getInputStream();

            int msg = is.read();

            System.out.println(msg);

            is.close();
            s.close();
            ss.close();

        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
